/*
 * DirectoryEntry.h
 *
 *  Created on: 26/10/2011
 *      Author: utn_so
 */

#ifndef DIRECTORYENTRY_H_
#define DIRECTORYENTRY_H_

#include "listaEntries.h"
#include "lista.h"

void printEntry(directoryEntry entry);
size_t conversion_8to16(char *utf8,char*utf16);
size_t conversion_16to8(char*utf16,char*utf8);
void readLongEntry(char *map, unsigned int offset,char **pname);
void readShortEntry(char *map, unsigned int offset,directoryEntry *entry);
void processEntry(char *map,directoryEntry* entry,unsigned int offset,unsigned char *flag);
int read_directory(char disk,NodoEntry **lst,const char *path,unsigned int rootclus,unsigned int* offset);
int read_entry(char disk,const char *path,unsigned int rootclus,directoryEntry *entry,unsigned int* offset);
int read_free_entry(char disk,uNodo **lst,const char *path,unsigned int rootclus,unsigned int *offset);
Nodo* clusterDeUnArchivo(char disk,const char*path,unsigned int numCluster);
unsigned int createNameEntry(char *nameToCreate,longEntry **longEntries,directoryEntry *shortEntry);
void createShortEntry(directoryEntry* shortEntry,unsigned int firstCluster,char attribute,char *extension);

#endif /* DIRECTORYENTRY_H_ */
